<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="xiaoximingxi" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 消息 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="主题" prop="subject">
              {{xiaoximingxi.subject}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="正文" prop="message">
              {{xiaoximingxi.message}}
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <div class="form-unit">
        <span class="mvc-title-left"> 附件 </span>
      </div>
      <el-table :data="fujianmingxi">
        <el-table-column label="文件" prop="file_item_id">
        </el-table-column>
        <el-table-column label="名称" prop="file_item_id">
          <template slot-scope="scope">
            <el-link @click="gotoPage('/xcapi/ProcessFile/DownloadFile.do?&fileid='+scope.row.file_item_id+''+vueparams+'')" type='primary'>{{scope.row.file_item_id}}</el-link>
          </template>
        </el-table-column>
      </el-table>
      <div class="form-unit">
        <span class="mvc-title-left"> 选择联系人 </span>
      </div>
      <el-table :data="xuanzelianxirenmingxi">
        <el-table-column label="联系人" prop="contact_id">
        </el-table-column>
        <el-table-column label="邮箱" prop="replyMail">
        </el-table-column>
      </el-table>
      <el-button @click="gotoPage('/crm/sale/contacts/PotentialContactsEmail?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'EmailDet',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        xiaoximingxi: {
          subject: null,
          message: null,
        },
        fujianmingxi: [],
        xuanzelianxirenmingxi: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/crm/sale/CustomerAction/emailDet?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
    },
  }
</script>
